package me.zhengjie.modules.protocol.rest;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.zhengjie.annotation.AnonymousAccess;
import me.zhengjie.annotation.Log;
import me.zhengjie.modules.protocol.domain.bo.StepOneBo;
import me.zhengjie.modules.protocol.service.AgreementStepService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wutong
 * @date 2024-12-06
 */
@Api(tags = "业务：协议填报")
@RestController

@RequestMapping("/api/agreement")
public class AgreementController {

    @Autowired
    private AgreementStepService agreementStepService;

    @Log("分步骤保存协议")
    @PostMapping("/saveStep")
    @ApiOperation("分步骤保存协议")
    @AnonymousAccess
    //@PreAuthorize("@el.check('agreement:add')")
    public ResponseEntity<Object> saveStep(@RequestBody @Validated StepOneBo stepOneBo){
        System.out.println(stepOneBo);
        return agreementStepService.saveStep();
    }

}
